package com.summer.framework.stream.controller.rpc;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @auther: 杨杰
 * @date: 2019/6/13 15:49
 * @description:
 */
@RestController
@RequestMapping("/api/num/test")
@Slf4j
public class NumAddController {
    private static volatile int num = 0;

    @PostMapping("")
    public int save() {
        num++;
        log.info(Thread.currentThread().getName() + "结果：" + num);
        return num;
    }


    @GetMapping("")
    public int get() {
        return num;
    }


}
